<template>
  <div>
    <el-dialog title="评论信息" :visible.sync="dialogVisible" width="1000px">
      <div class="evaluate">
        <List v-if="tableData.length" :tableData="tableData" />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Bus from "@/utils/bus.js";
export default {
  components: {
    List: () => import("@/components/review/List.vue"),
  },
  data() {
    return {
      dialogVisible: false,
      tableData: [],
    };
  },
  mounted() {
    Bus.$on("showDialogReviewInfo", (v) => {
      this.init(v);
    });
  },
  beforeDestroy() {
    Bus.$off("showDialogReviewInfo");
  },
  methods: {
    //显示弹窗
    init(v) {
      this.tableData = [];
      this.tableData.push(v);
      this.tableData.forEach((v) => {
        v.score = parseInt(v.score);
      });
      this.dialogVisible = true;
    },
  },
};
</script>
<style scoped>
.evaluate {
  min-height: 300px;
  max-height: 520px;
  overflow-y: scroll;
}
.evaluate::-webkit-scrollbar {
  display: none;
}
</style>